<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
	</head>
	<body>
		<h3>对象：人 firstname  lastname  sex aeg  fullName（）方法</h3>
		
		<script>
			
			var person = {
				firstname : "陈",
				lastname : "子枢",
				age : 2,
				fullName1 : function(){
					//函数里不能直接访问对象属性，加this关键字
					
					return this.firstname+this.lastname;
				}
				}
				
				console.log(person)
				console.log(person.fullName1());
				
				//动态添加
				person.fullName2=()=>{return person.firstname+person.lastname+person.age}
				console.log(person.fullName2())
			
			
		</script>
		
	</body>
</html>
